<html><head><script LANGUAGE="JavaScript">

function foo(i) {
    var reply = prompt("promt for "+i, "");
    alert ( "Nice to see you around these parts " + reply + "!");
}
</script>

</head>
<body>
<a href="javascript:foo(0);" onClick="foo(1);">Buy</a>
<input type="button" onClick="foo(0);" />
</body>
</html>